#ifndef VSINGERCOVEREFFECT_H
#define VSINGERCOVEREFFECT_H

#include <deque>

#include "VComplexWidget.h"
#include "VSingerEffect.h"




class CSingerCoverData;
class CSingerAnimationCtrl;
class VPicture;

struct singer_t;

class VSingerCoverEffect :
    public VSingerEffect
{
    IMPLEMENT_GETTHIS(VSingerCoverEffect);
public:
    VSingerCoverEffect(void);
    ~VSingerCoverEffect(void);
public:
    void init();
    bool render() const;
    void animate();

public:
    void push_back(singer_t* singer);
    // void pop_back();
    // void pop_front();
    void clear();

    void scroll_left();
    void scroll_right();
    void scroll_to(int mid);

    void animate_left();
    void animate_right();

    int item_per_page() const
    {
        return ITEM_PER_PGAE;
    };

    void mouseUp(int x, int y);
    void mouseDown(int x, int y);

    void auto_set_position();

    int current_position() const;
    int size() const;

    void set_item_texture(
        int itemno,
        GLuint* avatar,
        GLuint* name
    );

public:
    void switch_to_songsuui(singer_t* singer);

public:
    enum
    {
        ITEM_PER_PGAE = 5
    };

public:
    void initCoverData();
    void initData();
    void initCoverCtrl();
    void setCoverFlowGeometry(int x, int y, unsigned int w, unsigned int h);

public:
    void move(int x, int y);
    void resize(int w, int h);
    void mouseClick(int x, int y);

protected:
    CSingerCoverData* _coverdata;
    CSingerAnimationCtrl* _animate;
    int _covx, _covy;
    unsigned int _covw, _covh;

    int _oldx;
    bool _pressdown;
};


#endif // VSINGERCOVEREFFECT_H